<template>
	<view class="tab_warp fixed-bottom">
		<u-tabbar :value="value" @change="tabChange" :fixed="true" :placeholder="true" activeColor="#d81e06" :safeAreaInsetBottom="true">
			<u-tabbar-item text="首页">
				<image class="u-page__item__slot-icon" slot="active-icon" src="@/static/img2/h5_tabber/home2.png" mode="aspectFit"></image>
				<image class="u-page__item__slot-icon" slot="inactive-icon" src="@/static/img2/h5_tabber/home1.png" mode="aspectFit"></image>
			</u-tabbar-item>
			<u-tabbar-item text="看视频">
				<image class="u-page__item__slot-icon" slot="active-icon" src="@/static/img2/h5_tabber/product02.png" mode="aspectFit"></image>
				<image class="u-page__item__slot-icon" slot="inactive-icon" src="@/static/img2/h5_tabber/product01.png" mode="aspectFit"></image>
			</u-tabbar-item>
			<u-tabbar-item text="消息" :dot="dot">
				<image class="u-page__item__slot-icon" slot="active-icon" src="@/static/img2/h5_tabber/company02.png" mode="aspectFit"></image>
				<image class="u-page__item__slot-icon" slot="inactive-icon" src="@/static/img2/h5_tabber/company01.png" mode="aspectFit"></image>
			</u-tabbar-item>
			<u-tabbar-item text="我的">
				<image class="u-page__item__slot-icon" slot="active-icon" src="@/static/img2/h5_tabber/my2.png" mode="aspectFit"></image>
				<image class="u-page__item__slot-icon" slot="inactive-icon" src="@/static/img2/h5_tabber/my1.png" mode="aspectFit"></image>
			</u-tabbar-item>
		</u-tabbar>
	</view>
</template>

<script>
export default {
	data() {
		return {
			value: null,
			dot: false
		};
	},
	created() {
		this.dot = getApp().globalData.dot;
	},
	methods: {
		tabChange(e) {
			switch (e) {
				case 0:
					return this.goTab('/pages/home/index');
					break;
				case 1:
					let msg = { navIndex: 3, title: '看视频' };
					uni.setStorageSync('videoType', msg);
					return this.goTab('/pages/video/video_live');
					break;
				case 2:
					return this.goTab('/pages/message/index');
					break;
				case 3:
					return this.goTab('/pages/my/index');
					break;
			}
		}
	}
};
</script>

<style lang="scss" scoped>
.tab_warp {
	image {
		width: 40rpx;
		height: 40rpx;
		border-radius: 0;
	}
}
</style>
